<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    题干：<input
      type="text"
      placeholder="在此处写入题干"
      max="200"
      style="width: 80%"
      id="tg"
    /><br />
    选项A：<input
      type="text"
      placeholder="在此处写入选项A"
      max="200"
      style="width: 80%"
      class="xx"
    /><br />
    选项B：<input
      type="text"
      placeholder="在此处写入选项B"
      max="200"
      style="width: 80%"
      class="xx"
    /><br />
    选项C：<input
      type="text"
      placeholder="在此处写入选项C"
      max="200"
      style="width: 80%"
      class="xx"
    /><br />
    选项D：<input
      type="text"
      placeholder="在此处写入选项D"
      max="200"
      style="width: 80%"
      class="xx"
    /><br />
    正确答案：<input
      type="text"
      name=""
      placeholder="请输入正确题目的下标"
      id="zqda"
    /><br />
    解析：<input type="text" name="" placeholder="请输入解析" id="jx" /><br />
    分数：<input type="text" placeholder="请输入分数" id="fs" /><br />
    题目所属知识点：
    <select id="zsd">
      <option value="610bb594a50c000097006403">Vue</option>
      <option value="610bb5a1a50c000097006404">HTML</option>
      <option value="610bb5aaa50c000097006405">JavaScript</option>
      <option value="610bc4fba50c000097006411">React</option></select
    ><br />
    <button type="button">提交</button>
  </body>
  <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.9.1/jquery.js"></script>
  <script>
    $("button").click(function () {
      let tg = $("#tg").val(); // 题干
      // 选项
      let xx = [];
      $(".xx").each(function (index, value) {
        xx.push(value.value);
      });
      let zqda = $("#zqda").val(); // 正确答案
      let jx = $("#jx").val(); //解析
      let fs = $("#fs").val(); //分数
      let zsd = $("#zsd").val(); //知识点
      console.log(typeof zsd);
      $.post(
        "http://localhost:3000/my_add",
        { tg, xx, zqda, jx, fs, zsd },
        function (res) {}
      );
    });
  </script>
</html>
